import "package:flutter/material.dart";

import 'chat_all.dart';

/**
 * 聊天页面
 */

class chatPage extends StatefulWidget {
  chatPage({Key key}) : super(key: key);

  @override
  _chatPageState createState() => _chatPageState();
}

class _chatPageState extends State<chatPage> {
  List tabs = ["全部", "招呼", "沟通中"];

  @override
  Widget build(BuildContext context) {
    return DefaultTabController(
        length: 3,
        child: Scaffold(
            body: Column(
          children: [
            TabBar(
              indicatorColor: Color.fromARGB(255, 0, 215, 198), //指示器颜色
              labelColor: Colors.black87, //tab文字颜色
              unselectedLabelColor: Colors.grey,
              indicatorSize: TabBarIndicatorSize.label,
              tabs: tabs.map((e) => Tab(text: e)).toList(),
            ),
            Container(
              decoration: BoxDecoration(
                  border: Border(
                      bottom: BorderSide(
                          width: 0.5, color: Colors.grey)) // 也可控件一边圆角大小
                  ),
            ),
            Expanded(
              child: TabBarView(children: <Widget>[
                ChatAllTab(),
                // Center(child: Text('全部页面')),
                Center(child: Text('招呼页面')),
                Center(child: Text('沟通中页面')),
              ]),
            )
          ],
        )));
  }
}
